package com.jxs.android.weiget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.jxs.android.ges.R;

public class Bu_Work_Log_Item extends LinearLayout {

	TextView index;
	TextView date;
	TextView person;
	TextView content;

	public Bu_Work_Log_Item(Context context, AttributeSet attrs) {
		super(context, attrs);
		init(context);
	}

	public Bu_Work_Log_Item(Context context) {
		this(context, null);
	}

	public void init(Context context) {
		LayoutInflater.from(context).inflate(R.layout.bu_list_item_work_note, this);

		index = ((TextView) findViewById(R.id.index));
		date = ((TextView) findViewById(R.id.date));
		person = ((TextView) findViewById(R.id.person));
		content = ((TextView) findViewById(R.id.content));

	}

	public void setValue(String i_index, String i_date, String i_person, String i_content) {

		index.setText(i_index);
		date.setText(i_date);
		person.setText(i_person);
		content.setText(i_content);

	}

	public void setBackGroud(int bg) {

		index.setBackgroundResource(bg);
		date.setBackgroundResource(bg);
		person.setBackgroundResource(bg);
		content.setBackgroundResource(bg);

	}

	public void setTextColor(int color) {
		index.setTextColor(color);
		date.setTextColor(color);
		person.setTextColor(color);
		content.setTextColor(color);
	}

	public void setContentGravityCenter() {
		content.setGravity(Gravity.CENTER);
	}

}
